package tr.edu.metu.is.mega.server.core;

import java.io.Serializable;

import com.google.gwt.user.client.rpc.IsSerializable;

/**
 * Class to transfer paged query parameters.
 */
public class PagedQueryParams implements Serializable, IsSerializable {

    private static final long serialVersionUID = -8608531068590400019L;

    private int maxResults;

    private int firstResult;

    private String sortField;

    private SortDirection direction;

    /**
     * Default constructor.
     */
    public PagedQueryParams() {
    }

    /**
     * Default constructor.
     *
     * @param firstResult the index of the first result
     * @param maxResults number of results in a page
     */
    public PagedQueryParams(int firstResult, int maxResults) {
        this.firstResult = firstResult;
        this.maxResults = maxResults;
    }

    /**
     * Returns the maxResults.
     *
     * @return the maxResults
     */
    public int getMaxResults() {
        return maxResults;
    }

    /**
     * Sets the maxResults value.
     *
     * @param maxResults the maxResults to set
     */
    public void setMaxResults(int maxResults) {
        this.maxResults = maxResults;
    }

    /**
     * Returns the firstResult.
     *
     * @return the firstResult
     */
    public int getFirstResult() {
        return firstResult;
    }

    /**
     * Sets the firstResult value.
     *
     * @param firstResult the firstResult to set
     */
    public void setFirstResult(int firstResult) {
        this.firstResult = firstResult;
    }

    /**
     * Returns the sortField.
     *
     * @return the sortField
     */
    public String getSortField() {
        return sortField;
    }

    /**
     * Sets the sortField value.
     *
     * @param sortField the sortField to set
     */
    public void setSortField(String sortField) {
        this.sortField = sortField;
    }

    /**
     * Returns the direction.
     *
     * @return the direction
     */
    public SortDirection getDirection() {
        return direction;
    }

    /**
     * Sets the direction value.
     *
     * @param direction the direction to set
     */
    public void setDirection(SortDirection direction) {
        this.direction = direction;
    }

}
